﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ListAndHashTest
{
    internal class DictionaryDemo
    {
        Dictionary<int,Student> dics = new Dictionary<int,Student>();   

        public DictionaryDemo() { 
            for(int i=0;i<ListDemo.size;i++)
            {
                dics.Add((i + 1), new Student("n" + (i + 1), (i + 1)));
            }
        }

        public Student? GetStudent(int id)
        {
            Student? student = null;
            dics.TryGetValue(id, out  student);
            return student;
        }
    }
}
